home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The X-Philes (2nd Revision)
/
The X-Philes Number 1 (1995).iso
/
xphiles
/
hp48_1
/
radix50
< prev
next >
Wrap
Text File
|
1995-03-31
|
2KB
|
60 lines
This program is for the HP48SX.
For those of you who are still working with old DEC hardware, here are a
couple of programs that may be useful. They convert 3-character strings to/
from Radix-50 numbers. Radix-50 is/(was?) used to store 3 characters in one
16-bit word on PDP11's and is used for directory entries and task names under
RSX11, RT11 etc.
The program R50\-> converts a radix50 word (as a binary object) to a 3
character string, and the program \->R50 converts a string (up to 3 characters
long) to the coresponding radix50 word.
The word size must be set to >16 bits when using these programs, and you will
probably find it useful to set the base to octal.
I may write some more DEC-hacking programs, as I am still running a PDP11/45.
If anybody is interested, or has writen any such programs, please e-mail me.
Tony Duell.
e-mail : Janet ARD@UK.AC.BRIS.SIVA
Bitnet ARD@SIVA.BRIS.AC.UK
------------------>8-------------------->8-------------------->8-------------
%%HP: T(3)A(R)F(.);
DIR
\->R50
\<< " " SWAP +
DUP SIZE DUP 2 -
SWAP SUB 0 1 3
FOR n 40 *
OVER n DUP SUB
" ABCDEFGHIJKLMNOPQRSTUVWXYZ$.?0123456789"
SWAP POS 1 -
IF DUP 0 <
THEN
"Invalid String"
DOERR
END +
NEXT SWAP
DROP R\->B
\>>
R50\->
\<<
IF DUP
# 174777o >
THEN
"Invalid Radix 50"
DOERR
END B\->R "" 1
3
START OVER 40
MOD 1 +
" ABCDEFGHIJKLMNOPQRSTUVWXYZ$.?0123456789"
SWAP DUP SUB SWAP +
SWAP 40 / IP SWAP
NEXT SWAP
DROP
\>>
END